package actions;

//~--- non-JDK imports --------------------------------------------------------

import beans.MoveTopicFormBean;
import beans.SplitFormBean;

import dto.Topics;

import moderator.ModeratorControlPanel;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

//~--- JDK imports ------------------------------------------------------------

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MoveTopic extends org.apache.struts.action.Action {
    public MoveTopic() {}

    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
                                 HttpServletResponse response)
            throws Exception {
        ActionForward         forward = new ActionForward();
        MoveTopicFormBean     topic   = (MoveTopicFormBean) form;
        ModeratorControlPanel modCP   = new ModeratorControlPanel();

//      boolean done = 
        modCP.move(topic.getTopicId(), topic.getSectionId());

//      if(done)
        forward = mapping.findForward("OperationSuccessful");

//      else
//            forward = mapping.findForward("Operationfailed");
        return forward;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
